home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / system / mail / mailhand / metamail.z / metamail / bin / showpicture < prev    next >
Encoding:
Text File  |  1992-06-08  |  1.7 KB  |  57 lines

  1. #!/bin/csh -f
  2. # Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
  3. # Permission to use, copy, modify, and distribute this material 
  4. # for any purpose and without fee is hereby granted, provided 
  5. # that the above copyright notice and this permission notice 
  6. # appear in all copies, and that the name of Bellcore not be 
  7. # used in advertising or publicity pertaining to this 
  8. # material without the specific, prior written permission 
  9. # of an authorized representative of Bellcore.  BELLCORE 
  10. # MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY 
  11. # OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", 
  12. # WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
  13. #
  14. if (! $?X_VIEWER) then
  15. set X_VIEWER="xloadimage -view -quiet -geometry +1+1"
  16. # set X_VIEWER="xv -geometry +1+1"
  17. endif
  18. if ($1 == "-viewer" && $#argv > 1) then
  19.     set X_VIEWER = $2
  20.     shift
  21.     shift
  22. endif
  23.  
  24. if (! $?DISPLAY) then
  25.     echo ""
  26.     echo This message contains a picture, which can currently only be
  27.     echo viewed when running X11.  If you read this message while running
  28.     echo X11, and have your DISPLAY variable set, you will then
  29.     echo be able to see the picture properly.
  30.     echo ""
  31.     echo -n "Do you want to write the picture out to a file [y] ? "
  32.     set ANS=$<
  33.     if ("$ANS" =~ n* ||  "$ANS" =~ N* ) exit 0
  34.     echo -n "File name:"
  35.     set fname=$<
  36.     cp $1 $fname
  37.     if ($status == 0) echo Wrote file $fname
  38.     exit 0
  39. endif
  40.  
  41. echo NOTE:  TO MAKE THE PICTURE WINDOW GO AWAY, JUST TYPE 'q' IN IT.
  42. echo ""
  43. if ($#argv == 0) then
  44.     $X_VIEWER stdin
  45. else
  46. foreach i ($*)
  47.     set dir=$i:h
  48.     if ($dir != $i) then
  49.     # Make the ln sure to work    
  50.     cd $dir
  51.     endif
  52.     ln $i $$.PRESS-q-TO-EXIT 
  53.     $X_VIEWER $$.PRESS-q-TO-EXIT
  54.     rm $$.PRESS-q-TO-EXIT 
  55. endif
  56.